package com.quanyan.place.service.impl;

import com.quanyan.place.entity.TbBizPlacePeriod;
import com.quanyan.place.entity.TbBizPlacePeriodExample;
import com.quanyan.place.mapper.TbBizPlacePeriodMapper;
import com.quanyan.place.service.TbBizPlacePeriodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 场馆内部Serivice实现类
 *
 * Created by yangyun on 2016/4/19.
 */
@Service("tbBizPlacePeriodService")
public class TbBizPlacePeriodServiceImpl implements TbBizPlacePeriodService {

    @Autowired
    TbBizPlacePeriodMapper tbBizPlacePeriodMapper;

    @Override
    public List<TbBizPlacePeriod> getPeriodInfoByPlaceId(Integer placeId) {
        TbBizPlacePeriodExample periodExample=new TbBizPlacePeriodExample();
        TbBizPlacePeriodExample.Criteria periodCriteria=periodExample.createCriteria();
        periodCriteria.andPlaceIdEqualTo(placeId);
        List<TbBizPlacePeriod> listVal= tbBizPlacePeriodMapper.selectByExample(periodExample);
        return listVal;
    }

    @Override
    public void deletePeriodInfoByPlaceId(Integer placeId) {
        TbBizPlacePeriodExample periodExample=new TbBizPlacePeriodExample();
        TbBizPlacePeriodExample.Criteria periodCriteria=periodExample.createCriteria();
        periodCriteria.andPlaceIdEqualTo(placeId);
        tbBizPlacePeriodMapper.deleteByExample(periodExample);
    }
}
